package mysql

import "gorm.io/gorm"

type MeiTuan struct {
	gorm.Model
	Cover  string  `gorm:"type:varchar(30);not null"`
	Name   string  `gorm:"type:varchar(30);not null"`
	Num    int     `gorm:"type:int(11);not null"`
	Price  float64 `gorm:"type:decimal(10,2);not null"`
	Status string  `gorm:"type:varchar(30);not null"`
}

func (m *MeiTuan) Create() error {
	return DB.Create(&m).Error
}
func (m *MeiTuan) Info(MeiTuanId int64) error {
	return DB.Where("id = ?", MeiTuanId).Limit(1).Find(&m).Error
}
